<template>
<div class="home-nav">
  <ul class="ul">
    <li v-for="(item,index) in dataList" :key="index">
      <a :href="item.path">
        <img :src="item.img">
        <img :src="item.img_hover">
        <span>{{item.title}}</span>
      </a>
    </li>
  </ul>
</div>
</template>

<script>
export default {
  name: "HomeNav",
  data() {
    return {
      dataList: [
        {
          img:require('@/assets/images/homeNav/icon1.png'),
          img_hover:require('@/assets/images/homeNav/icon1.png'),
          title:'金融服务',
          path:'/FinancialService'
        },
        {
          img:require('@/assets/images/homeNav/icon2_hover.png'),
          img_hover:require('@/assets/images/homeNav/icon2_hover.png'),
          title:'购销管理',
          path:'/'
        },
        {
          img:require('@/assets/images/homeNav/icon3.png'),
          img_hover:require('@/assets/images/homeNav/icon3.png'),
          title:'仓储管理',
          path:'/'
        },
        {
          img:require('@/assets/images/homeNav/icon4.png'),
          img_hover:require('@/assets/images/homeNav/icon4.png'),
          title:'运输管理',
          path:'/transport'
        },
        {
          img:require('@/assets/images/homeNav/icon5.png'),
          img_hover:require('@/assets/images/homeNav/icon5.png'),
          title:'质量档案',
          path:'/'
        },
        {
          img:require('@/assets/images/homeNav/icon6.png'),
          img_hover:require('@/assets/images/homeNav/icon6.png'),
          title:'数据决策',
          path:'/'
        }
      ],
    };
  },
  methods: {

  }
}
</script>

<style scoped>
.home-nav ul {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.home-nav ul li {
  list-style: none;
}
.home-nav ul li a{
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 276px;
  height: 78px;
  background-image: url("@/assets/images/homeNav/nav_bg.png");
  background-size: 100% 100%;
  line-height: 78px;
  gap: 18px;
  font-size: 16px;
  font-weight: 500;
  color: #FFFFFF;
}
.home-nav ul li a img{
  width: 24px;
  height: 24px;
}
.home-nav ul li a img:last-of-type{
  display: none;
}
.home-nav ul li a:hover{
  background-image: url("@/assets/images/homeNav/nav_bg_hover.png");
  color: #09205A;
}
.home-nav ul li a:hover img:first-child{
  display: none;
}
.home-nav ul li a:hover img:last-of-type{
  display: block;
}
</style>
